package com.qupai.lib_base.widget.sticker.utils

import android.graphics.Bitmap
import android.graphics.Matrix

object PointUtils {
    /**
     * 将matrix的点映射成坐标点
     *
     * @return
     */
    @JvmStatic
    fun getBitmapPoints(bitmap: Bitmap, matrix: Matrix): FloatArray {
        val dst = FloatArray(8)
        val src = floatArrayOf(
            0f, 0f, bitmap.width.toFloat(), 0f, 0f, bitmap.height.toFloat(), bitmap.width.toFloat(), bitmap.height.toFloat()
        )
        matrix.mapPoints(dst, src)
        return dst
    }
}